/**
 * Copyright (c) 2013-Now http://jeesite.com All rights reserved.
 * No deletion without permission, or be held responsible to law.
 * @author dong
 */
import { defHttp } from '/@/utils/http/axios';
import { useGlobSetting } from '/@/hooks/setting';
import { BasicModel, Page } from '/@/api/model/baseModel';

const { adminPath } = useGlobSetting();

export interface JydqProductPrice extends BasicModel<JydqProductPrice> {
  productId?: string; // 商品ID
  platformId?: string; // 平台ID
  platformName?: string; // 平台
  currentPrice?: number; // 当前售价
  priceValidity?: string; // 价格生效时间
  nextUpdate?: string; // 下次更新时间
}

export const jydqProductPriceList = (params?: JydqProductPrice | any) =>
  defHttp.get<JydqProductPrice>({ url: adminPath + '/jydq/productPrice/list', params });

export const jydqProductPriceListData = (params?: JydqProductPrice | any) =>
  defHttp.post<Page<JydqProductPrice>>({ url: adminPath + '/jydq/productPrice/listData', params });

export const jydqProductPriceForm = (params?: JydqProductPrice | any) =>
  defHttp.get<JydqProductPrice>({ url: adminPath + '/jydq/productPrice/form', params });

export const jydqProductPriceSave = (params?: any, data?: JydqProductPrice | any) =>
  defHttp.postJson<JydqProductPrice>({ url: adminPath + '/jydq/productPrice/save', params, data });

export const jydqProductPriceDelete = (params?: JydqProductPrice | any) =>
  defHttp.get<JydqProductPrice>({ url: adminPath + '/jydq/productPrice/delete', params });
